home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
math
/
maca_101.zip
/
EQUATION.DEM
< prev
next >
Wrap
Text File
|
1996-01-30
|
3KB
|
101 lines
;EQUATION.DEM
;DEMO FILE FOR MASSCALC VERSION 1.00
;WRITTEN BY: Ralph W. Reid
;This file may only be distributed in its unmodified form.
;
;DESCRIPTION: This file primarily demonstrates equation formats.
;
;For the latest releases of MASSCALC and other software created by
;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
;
;HOW TO USE THIS FILE: This file may be piped into MASSCALC, and its
;output displayed as follows:
;TYPE EQUATION.DEM | MASSCALC | MORE
;This file may be redirected into MASSCALC and its output displayed
;as follows:
;MASSCALC < EQUATION.DEM | MORE
;These two commands should be run from the operating system prompt.
;the simplest equation (a single value)
print: "A simple value:"
29.5;
;a predefined constant as an equation
print: "A predefined constant (_e):"
_e;
;some simple additions
print:
print: "some results from a few simple additions:"
1+1;
_pi + _pi;
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10;
;some more simple equations
print:
print: "results from some more simple equations:"
1 / 2;
2 ^ 3;
3 * 5 / 10 - 0.5;
-4 + 2 ^ 2 * _pi / 8.2;
;include some functions
print:
print: "results of some equations which include functions:"
sin (_pi / 2) + cos (4 - 2 ^ 2);
3 ^ sin (_pi_2) + log (100);
;include parentheses in equations
print:
print: "results from equations including parentheses:"
2 ^ (1 + 3);
(sin (_pi / 2) + log_b (2, 2)) ^ log (100);
1 / (floor (exp (1)) * sin (_pi / 2));
;equations with variables
print:
print: "results from some equations which include variable assignments:"
var1;
var1 = 1 + floor (sin (_pi / 2)) * log (10);
var1;
var1 = 2;
pi = _PI;
final = sin (pi / var1) + log_b (var1, var1);
final = final * 5;
final;
;split some equations across several lines
;The length of any equation is the total length of all of its lines
;added together; this total must not exceed the maximum line length
;set by MASSCALC.
print:
print: "results from equations spread across more than one input line:"
sin (_pi / 2) +
1 ^ 2e5
+ floor (sin (0));
sin (_pi / 2) / cos (_pi / 2) -
tan (_pi / 2);
ln (exp (1))
+ log (10) ^ 18
- 2 +
log_b (var1, var1);
;using special function results in equations
print:
print: "adding some results of special functions to equations:"
root value = root_secant (x, 1, 2, x - sqrt (2));
root value ^ 2;
root value / sqrt (2)
+ 1;
x = 3;
der value = derivative_1 (x, x^2);
der value = ceil (der value); removes approximation error for this value
der value;
root value / _sqrt_2
* der value
+ log_b (3, 3^4);